package com.hjj.dsaa.introduction;// MemoryCell class
//  Object read( )         -->  Returns the stored value
//  void write( Object x ) -->  x is stored

/**
 * <p>使用Object表示泛型</p>
 * <p>不能使用使用基本类型：需要使用包装类</p>
 * @param <AnyType>
 */
public class MemoryCell<AnyType> {
    // Public methods
    public AnyType read() {
        return storedValue;
    }

    public void write(AnyType x) {
        storedValue = x;
    }

    // Private internal data representation
    private AnyType storedValue;
}
